/*
 * File Name：BaseWebActivity.java
 * Copyright：Copyright 2008-2012 CiWong.Inc. All Rights Reserved.
 * Description： BaseWebActivity.java
 * Modify By：PLA-ZJLIU
 * Modify Date：2012-11-22
 * Modify Type：Add
 */
package com.ciwong.ciwongwrite.ui;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/**
 * 习网应用根Activity，整个app的所有Activity必须继承
 *
 * @author jejun
 * @version ciwong v.1.0 2012-10-28
 * @since ciwong v.1.0
 */
public abstract class CWBaseActivity extends Activity
{

    /**
     * {@inheritDoc}
     */
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(setView());
        findViews();
        init();
    }

    /**
     * 设置内容
     *
     * @return 返回一个View
     */
    protected abstract int setView();

    /**
     * 查找元素(控件)
     */
    protected abstract void findViews();

    /**
     * 初始化操作(如初始化事件)
     */
    protected abstract void init();

    /**
     * 隐藏软键盘
     *
     */
    public void hideSoftKeyBoard()
    {
        ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE))
                .hideSoftInputFromWindow(this.getCurrentFocus()
                        .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    }
}
